<?php
	/**
	 * Title: Superclass for all the html tags.
	 * @description: The baseclass for all html tags.
	 * @author Oddleif Halvorsen | leif-h@online.no
	 * @version 1.0
	 */
	
	error_reporting(E_ALL);
	
	// Include version information
	require_once("common/version.inc.php");
	
	class HTMLTag
	{
		// GetVersion
		// Returns version information
		// 
		// Retuns a string containing the version
		function GetVersion()
		{
			return VERSION." b".BETA_VERSION;
		}
		
		//Variables in commen for (almost) all HTML tags.
		var $id;
		var $class;
		var $title;
		var $style;
		
		/**
		 * Constructor that instansiate alle the local variables.
		 */
		function HTMLTag(){
			$this->id = NULL;
			$this->class = NULL;
			$this->title = NULL;
			$this->style = NULL;
		}
		
		function setId($id){ $this->id = $id; }
		function setClass($class){ $this->class = $class;	}
		function setTitle($title){ $this->title = $title;	}
		function setStyle($style){ $this->style = $style; }
		
		function getId(){	return (isset($this->id) ? $this->id : FALSE); }
		function getClass(){ return (isset($this->class) ? $this->class : FALSE);	}
		function getTitle(){ return (isset($this->title) ? $this->title : FALSE);	}
		function getStyle(){ return (isset($this->style) ? $this->style : FALSE);	}
		
		/**
		 * Returns the html attributes that is set
		 * @return A text string with the attributes on the form: ' attribute="value" attribute="value"'
		 */	 
		function getAttributes(){
			$attributes = "";
			
			if($this->getId())
				$attributes .= " id=\"" . $this->getId() . "\"";
			if($this->getClass())
				$attributes .=  " class=\"" . $this->getClass() . "\"";
			if($this->getTitle())
				$attributes .=  " title=\"" . $this->getTitle() . "\"";
			if($this->getStyle())
				$attributes .=  " style=\"" . $this->getStyle() . "\"";
			
			return (isset($attributes) ? $attributes : FALSE);
		}
	}
?>